<?php

use App\Http\Controllers\Invoice\MapiController;
use App\Http\Controllers\Third\OceanEngine\OceanEngineController;
use App\Http\Controllers\Third\Xiaoke\XiaokeController;
use App\Http\Middleware\Invoice\ResponseMiddleware;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Callback\Pay\PayController;
use App\Http\Controllers\Fee\FeishuApply\FeeAnnualOrderController;

/**
 * 项目回调路由
 */

/**
 * 支付回调路由
 */
Route::group(["prefix" => "pay"], function () {
    Route::any("/", [PayController::class, "pay"]);

    // 开店设备费支付成功回调
    Route::group(["prefix" => "openShop"], function () {
        Route::post('paySuccess', [PayController::class, 'openShopPaySuccess']);
    });

});

// 开店订单入口
Route::get('appEntrance/{shopId}', [\App\Http\Controllers\OpenShop\Merchant\ConfigController::class, 'appEntrance']);

Route::group(['prefix' => 'fee'], function () {

    // 年管理费支付情况
    Route::get('payStatus', [FeeAnnualOrderController::class, 'feePayStatus']);

    // 批量获取年费收取日期
    Route::get('getFeeTime', [FeeAnnualOrderController::class, 'getFeeTime']);
});

// 开票回调
Route::group(['prefix' => 'invoice', 'middleware' => [ResponseMiddleware::class]], function () {

    // 盟度开票回调
    Route::any('mapi', [MapiController::class, 'callback']);
});

// 巨量引擎回调
Route::group(['prefix' => 'oceanEngine'], function () {
    // 授权码回调
    Route::get('oauth', [OceanEngineController::class, 'oauth']);
});

// 销氪回调
Route::group(['prefix' => 'xiaoke'], function () {
    // 授权码回调
    Route::any('notify', [XiaokeController::class, 'notify']);
});
